From: David Bauer Date: Sat, 23 Oct 2021 22:40:55 +0000 (+0200) Subject: remote: always re-schedule update timeout X-Git-Url: http://git.openwrt.org/%22https:/collectd.org//%22http:/www.crowdsec.net/%22/%22https:/collectd.org/%22http:/www.crowdsec.net/%22?a=commitdiff_plain;h=681354256fb334acfc7572be02afa21bde5094a1;p=project%2Fusteer.git remote: always re-schedule update timeout This commit fixes updates not triggering due to a race-condition in usteer. When usteer does not yet have local-nodes when loading config, the scheduled remote-update is not re-scheduled, leading to usteer only exchanging node-messages on STA-events, leading to expiring remotes on other remote nodes in low-event scenarios. Signed-off-by: David Bauer --- diff --git a/remote.c b/remote.c index a464b3b..37d80e6 100644 --- a/remote.c +++ b/remote.c @@ -622,17 +622,16 @@ usteer_send_update_timer(struct uloop_timeout *t) struct usteer_node *node; void *c; - if (avl_is_empty(&local_nodes) && !host_info_blob) - return; - usteer_update_time(); uloop_timeout_set(t, config.remote_update_interval); - c = usteer_update_init(); - for_each_local_node(node) - usteer_send_node(node, NULL); + if (!avl_is_empty(&local_nodes) || host_info_blob) { + c = usteer_update_init(); + for_each_local_node(node) + usteer_send_node(node, NULL); - usteer_update_send(c); + usteer_update_send(c); + } usteer_check_timeout(); }